update the function that used to compress the string like this: aaaaabb to a5b2