Added same logic for implication and logical equivalence