completed the argument parssing. tests are missing
fixed the argument parsing code. not tested with actual user programs