adjusted weighting functioin