added some code to calculate price based on distance with the big table