function of variable resistor in a circuit