restructured to work in heroku