added reverseText function
added implementation for reverse text