pseudo-code to active_to_selected support