added compress/uncompress methods