slight optimization for printWeights()