Added comments to make the idea more clear.