added getopt but didn't integrate