added the normalization function