Finished to write compaction code. Related tests implementation is in progress.