added more options, cleanup, comments