chaned command line handling + getopt