Changes to the main program to try and detect stations