Various minor changes + added the rendering loop