Add commandline argument for json file and cleaned up code a bit.