if(command.toInt() < 1000){
if(command.toInt() != 1001) {
if(command.toInt() != 1002) {
If the value is less than 1000, it can't possibly be 1001 or 1002, can it? It seems pointless to make sure that a value that is less than 1000 is not 1001 and is not 1002.