added functionality to viewcontroller