Attempt to huffman on nbits but segmentation fault