Fix simple algorithm
Add some comments to simple algorithm