added method getWeights