Added minheap to encoder and decoder.