Changing heuristic function to use different distance