cleaning up examples and creating interface to change rendering type on the fly