Add logic gate functions