Changes to generator and added caching to graphics.