Implemented invert method