Thanks Jang for giving me which pieces to use in which combinations. I'm trying this out now.
As I loop back to get the previous heading, am I going to have trouble getting Pgfs in document order? I was planning on using Pgf.PrevPgfInFlow, NextPgfInFlow to do this.
Thanks, Mark