Comments

Added a bunch of comments to the code to explain my thought process.