refactored cycle into scan and scan into scnr:scanCmd