@Override
    public void removeElement() {
        if (depthManager.getMaxDepth() > 1) {
            DepthRow lastRow = depthManager.getDepth(depthManager.getMaxDepth() - 1);
            if(!lastRow.isEmptyRow()){
                return;
            }

            depthManager.removeLastDepth();

            boolean first = true;
            for (int i = depthManager.getMaxDepth() - 1; i > 0; i--) {
                DepthRow depth = depthManager.getDepth(i);
                if (first) {
                    first = false;
                    recalculateLastDepth(depth);
                } else {
                    recalculateNodesPositions(depth,depthManager.getMaxDepth());
                }
            }
        }
    }