completed adding support for weighting
Merge branches 'weight' and 'master'