added the getDirections method for the trains