fixed distance calculations and initialization