Added comments to make clearer.