normalizing bgMean and bgVar