Comments and links

Added more comments to explain parts and inserted table of contents
links.