distance method change and degree error cases handeld