changed from LSB replacing to LSB matching