Single scan completed, half done.

Just finished single scan function. Independent from database, need to
finish some minor bugs, "count" function not finished.