Added Invert function.