Added requestAnimationFrame for updating graphics, graphics should run smoother and use less cpu now