Added PA flow function stuff
and the PA tests...