Got huff transform algorithm working