You may have reversed the order of the functions when subtracting.