changed the setCurrentSpeed method