It is well known that an algebra with permuting congruences and M3 as its congruence
lattice is abelian. We present a condition on the congruence lattice that forces a finite
algebra with a Mal?cev term to be nilpotent. For expanded groups, we prove that if this
condition fails, then the algebra has a non-nilpotent expansion with the same congruence
Another condition on the congruence lattice tells when the expansion of the algebra with
all its congruence preserving functions is supernilpotent.