fix buildHuffman() to scan backwards for first occurrence of next smallest number