you need to change your check to <4 if you have 4 stations because your array is 0 indexed, so station 1 is index 0, station 4 is index 3, null is 4.
you need to change your check to <4 if you have 4 stations because your array is 0 indexed, so station 1 is index 0, station 4 is index 3, null is 4.