I think it's confusing that the Javascript implementation seems to differ from the algorithm mentioned above. It would be nice to have more explanation added to the javascript code. For myself I can only follow along until the calculation of the first coefficient then I can't relate the code to the article above.