Allowing arbitrary matrix size.
Implemented Huffman histogram example code.