finally reworked the button-reading code to use the resistor model.