added codeval calculate distance