working ADC Code