Make sure you do this:

R = B +(f * P)

and not this:

R=(B+f) *p
Big difference

most would shit their pants anyway as they have to add with a fraction