Few changes to make Khalil's code work in the simulator