Added comments

Added some comments to the sloppy code. I didn't add them for every
declaration, but it is still understandable.