add segmented. improve logc and interface