24.04.2014, 16:03
Add before and in each command a print statment and check the value of cmd (that is called debugging)
Also change the else if's into normal if statments, you don't need else if you are using return
Also change the else if's into normal if statments, you don't need else if you are using return