invert method