move more distance calculations to float