fixed up reverse string generation