Use requestAnimationFrame instead of setInterval