public void moveChild(Constituent newChild, int index) {
        System.out.println(newChild.parent == null);
        int oldIndex = children.indexOf(newChild);
        System.out.println("Old index = " + oldIndex);
        System.out.println("New index = " + index);
        
        if (oldIndex != -1 
                && (oldIndex == index || oldIndex + 1 == index) ) {
            System.err.println("tried to move child to same index");
            return;
        }
        
        if (newChild.isAncestor(this)) {
            System.err.println("tried to move child to ancestor");
            return; 
        }
        if (newChild.parent != null) {
            newChild.parent.children.remove(newChild);
            newChild.parent = this;
        }
        if (oldIndex != -1 && oldIndex < index) {
            index--; // to account for prior removal from parent
        }
        
        try {
            children.add(index, newChild);
            System.out.println("successfully moved child");
        }
        catch (IndexOutOfBoundsException ex) {
            System.err.println("tried to move child outside of bounds");
            children.add(newChild);
            System.out.println(children.size());
        }
        
        newChild.parent = this;
    }