Move array sorts outside of functions

I need in-order results for Challenge 6
Challenge 6