Added comments to some code