Can you add some comments to explain how does it works?