Fixed seg fault in railroads, sorted schedules, and started the for loop