added comments about weighting algorithm