reverse string slightly modified