Got graphics to render and cleaned up code