added debug, and getopt