changed | to & in readReg