Clean up compression algorithm some more