Implemented the digital read loop(s)