updated to allow passing of custom renderer
added some tests for custom renderers