flag transitions

Addresses #36.