Replace setInterval with requestAnimationFrame
Improvements for touch devices