weights are defined in the class