finalized resistor recognition, cleaned up output