I cleaned up a lot of code and added a ton of comments