Made string reverse function useful outside of the file and completed palindrome check as well.