Revert "Revert P2/P3 changes"

This reverts commit bbbdc0a7a6b9dbaeb65ec2ccd4be714b2d8841bb.

Looks like to fully match the draft I have to put this code back in...
It's getting ugly from here, but that's what I've got to do if I want
full conformance.