changes according to @kylerush. need to implement browserify