Ok so i have this equation which I am having difficulty in figuring out how it was derived.

this is the original equation

$\displaystyle \frac{M_s}{P} = L_0 +L_yY +L_rr$

this is the equation i cant figure out how to get to.

$\displaystyle r = \frac{1}{L_r}[\frac{M_s}{P}-L_0] - \frac{L_y}{L_r} Y $

If someone has the time to do a step by step explanation of how to rearrange it to get r, it would help me immensely.

Thanks.