functioning getTrains