for controlling the speed