Explain the algorithm in the README