updated to make the negative function return the answer