added basic command line options processing. TODO: integrate command options with program control