now supports logging and options