part of Haffman's algorithm