Added delay within else statements in setMotorSpeed