Solved the problem of merging and compression problem