variable resistors function