working on tranfering to browserify