Changed getWeight function, so that it is more intuitive (see description)