Added is_subset checking with maxgap=0