Added functionality to main view.