Use of requestAnimationFrame for performance speed up