Refactored displayLines and displayStations functions