working on segmented scan