new deter, invert functions