Rewritten in node.js.