Added debugging things in loopSwitch method in view controller class.