implementation of velocity control