converted into npm module, using browserify to test in browser