Working for simple one to one constrainst.