changed the weightedpopularity calculation