changed 'ticking' method to rAF