added method for calculating direct distance