Added palindrom checking algorithm