Added comments to document the reasoning and workings of various design decisions.