Adding override-able UpdateGates function