Added comments to the majority of functions that are new/heavily edited.