Implementing motion optimization