Added C code for running the elevator