Added comments to explain things.