Basic linear, advice needed

Hi guys, I'm think im missing a step here:

cost in pounds = **C=500+10X** *(x=no. units produced)

revenue in pounds = **R=150X - 3X^2**

I work out the weekly profit by subtracting C from R, which = **P**.

I need to show that, in terms of the number of units produced (X), the weekly profit is given by,** P =140X - 500 - 3X^2**.

So far I havedone P = R - C

p = (150X - 3x^2) -(500 + 10X)

= 140X - 3X^2 - 500

Have i shoen that in terms of X as I needed to, as my 500 and 3X^2 are the other way round....This is what confuses me.

Any light you could shed on this would be great,

Thank you.