Added more documentation. Optimized Controller/Model.