Copied RecursiveReverse from the PDF