added requestAnimationFrame usage