Is this a book error? Can't figure it out...

"Consider the demand equation:

p = -.02x + 400 (0< x < 20,000) (greater than or equal to)

Solving the demand equation for x in terms of p we find:

x = f(p) = -50p + 20,000

I can't figure out how the second is derived from the first. Some guidance would be appreciated.