added analogue input support