added getopt