A from-scratch huffman compression algorithm