cleaned up code to support both Cloud9 and Heroku deployments