Add pythagorean calculation to calculateWeight().