defines each post as an object and gives that object properties like pid, height top and children. children is supposed to be the objects children that are of the class .surround-inserted. right now, children returns all of the objects .surround-inserted children, not just it's own.
all i had to do was move the declaration of the empty pkid array so that it would be within the scope of only the conditional if object.find('surround-inserted').