generate_data: sort using python's builtin method instead of quicksort