added getopt to NS