Add some comments to simple algorithm