add delegate methods to view controller and implement data source