added parameters for speed control