fixed two bugs, ~a == C case added