How Railway Systems Work