Added weighting and empty/max scoring