added dynamic speed control