working on a better register compaction