Added a rendering loop