adding velocity calculations