fixed bug with negation of function