add verbose and version switches, some debugging