implement stat and scan mode