Cleaned lz77 code