Adds docopt
Cleans up code