added test code to viewController