Invert() bug fixed. Works perfectly fine