adding velocity computation