move distance calculations to float