added potentiometer code