Added the getWeight() method