Changed gate system to ensure each block has an instance of the gate.