Solved #35 for trains (Closes #35)