index.html refactored
functions added to controller.js