refactored functions
heroku changes made