1.Updated the notation. 2. Removed setTimeout function instead of requestAnimationFrame function