Added recursive isSymmetric function.