Working on invert function.