For what it's worth, add some comments to describe this algorithm