fixed: weighting was not working properly