compressString code