using getopt for commandline parsing