updated gated vdd function