add tests with segmentation