generalized comparision