Removed residual floating point calculation in final algorithm.