move sort in scout search outside of loop