First draft of stacking order / topmost flag support