updated to make use of docopt.
updated both to use docopts and tidy of code