Two small changes:
1. Fixed bug where boolean "and" was incorrectly used instead of bitwise "&".  We're testing a bit in a byte.
2. Moved the sleep call to BEFORE the first read.  Occasional errors with immediate read after write.