first draft of converting to browserify