Updated getParentString() method