trying to implement getopt