floating point bug fixed