switch setSpeed to accept and int