adding comments to make it clear what is happening in this example