add helpers to generate boundary flags
only use ratios, no floats