fix for last bits in compress function