wrote a recursive selection sort