114 implement compaction

Implementation of #114 compaction in local adapters. Thanks to @adampolak for discussing the problem with me!