def insertion_sort(arr):
    # Iterate through the list starting from the second element
    for i in range(1, len(arr)):
        key = arr[i]
        j = i - 1
        
        # Compare and swap elements if they are out of order
        while j >= 0 and key < arr[j]:
            arr[j + 1] = arr[j]
            j -= 1
        
        # Insert the key at its correct position
        arr[j + 1] = key
    
    return arr
Write a Python function to implement the insertion sort algorithm on a list of strings. The function should take a list of strings as input and return a sorted list based on alphabetical order.
PLAINFORMAT