Imprevement to the logic about whether train is coming toward or going
away