add segmented scan
fix bug in segmented scan