Created analog read function