Removed some print statements and altered a print statement in waitForCommand