Adds support for weights.