changed name of invert() to firstInversion()