new normalization code finished