Updated Potentiometer Code