add Scan mode,finish the skeleton