Removed obselete functionality
created distance calculation function

still needs factor to calculate