Added the selection weight g to the two layers of the circuit.