Changed if statement

Changed if statement in the do-while in the main method, as we assume
that the input commands are 3 and not more.