Revised doc to better explanation of algorithm