Code Cleanup

Add util files.
Add error checking on run.