distance calc - more definitions