def insertion(elements):
    """Insertion Sort alogrithm

    Given a list of elements, sorts them using the Insertion Sort:
    Compares every element with the previous ones and finds the correct position
    to place it.

    Parameters
    elements: List of elements to be sorted

    Returns
    list of sorted elements
    """
    for i in range(1,len(elements)):
        key = elements[i]
        index = i
        #traverse every previous member of the list
        while index > 0 and elements[index-1] > key:
            elements[index] = elements[index-1]
            index = index-1
        #place key in new founded position
        elements[index] = key
    
    return elements