Simplification by separation

I have separated out the components of the calculation to more clearly
see the logic of it.