1) %alpha2 = $+(%alpha2,$mid(%alpha1,%c,1),$chr(32)) is not appending a single space to a variable, but rather appending a single character and a space to a variable. Normally I would've preferred to use $addtok for something like this, but for this specific situation $addtok would not work, as duplicate letters (such as the 2 l's in hello) would only show as one letter.