Removed lastMatch from thecompress function and renamed orgRes orgChunk in the extendMatch function