Added remove sub doc and sub sub …n doc functionality