added inefficient implementation of palindrom