Made some code neater so it is more clear what is going on. Fixed the main algorithm to go to the next station every iteration of the loop.