recursive sort of children_d #847

child is added before grand children and grand children of following
brothers