bug in compression algorithm