Added a method to check if a list is a palindrome or not