LZ-78 Implementation