updated all functions to app.rb