improved output selection scheme