Adding comments to the code now that I have completed debugging it.