used getopt_new instead of getopt. actually works.