replaced references to argv[0] with progname, added more doc stuff