normalization code