Using frame ticks instead of time
- Adding requestAnimationFrame instead of setTimeout