Improve speed by using floats for comparison