Implemented the LZ77 method