small program to invert a given string