small changes, parse command line arguments
working implementation