Elevator simulator in C