Implemented comparator and segmenter classes