Reformat the nesting function.