Adding logic for passing a floor

Maths for finding parameters of next decision point, based on parameters
for the current decision point.