initial support for encoding added
better support in decoder
better huffman structure