Added section why the algorithm works