Implement a basic algorithm for sorting an array.
Write sort_array(nums) to sort an array of integers in ascending order without using Python's built-in sorting functions. Modify the input array in place and return it. The array may be empty and may contain duplicate or negative values.
def sort_array(nums):