pD[n] is working again for both forward and backward cases,
and pd[n] only works for forward case right now.