tweaked canvas width to remove scroll bar
better usage of requestAnimationFrame instead of using time intervals