using getopt for option parsing