added two functions to handle removing the process from the hardware and getting the next command to be executed.