commented and refactored main.controller and main.html