Changed to ScanFlash and Some Optimization