added digital read functionality