working runlengthencoding with a more haskell like group approach