resistor implementation