Added Tristate gate