function of variable resistor