Implemented weighting
Merge branch 'develop'