Finished cleaning up code

Also fleshed out run.py a little bit