time to rewrite the whole thing in node.js