changed the normalization algorithm