added --verbose and --main switches