updating velocity