Moved calculations into controller and updated view accordingly.