Finished LogicGates implementation