have flags working ready for more complex corner cases