Motion and velocity calculation