make grouping of comparison correct