Added lz77_encode function.