Add function changing the speed