Implemented getWeights().