Get pp4 finally working.
Still need to check possible edge cases.