Changes ported from the original article.