Getopt re-written