o replaced select by apply
o put the changed representation of pfun in the tests