added analog input support