added correct distance to the function headers