sort an array without using .sort exercise