change criterion: always restart code compaction. To be revisited.