updated readRegB to correct output