finished the weighting for the layer class