Removing extra pin reads

Removed a few near-sequential pin reads to reduce the chances of missing a state change due to one value being read for the compare, then a different one being stored.
Merge pull request #10 from Enigmatheatre/Bug-fixes-for-final

Removing extra pin reads