rewrite in node - way smarter now
0.2.0