distance calc- working prototype