refactored app.js, added some set functions.