added support for a few new kwargs to the preview function + cleanup