working with printed weights and leaf numbers