Added a significant amount of comments to the code. Probably overdid it.