Organise flag sets and add some missing ones.
Implement %p