Ditch requestAnimationFrame, it's unreliable