Switch to requestAnimationFrame