Updating to use core motion framework