removes unnecessary NOT operator