algorithm for calculating journeys is working