Corrected the negate function