implemented and gate