The code is bulky and changes the entire original palindrome, but the palindrome parts do work.