def bubble_sort(arr):
    """Refresher implementation of buble-sort - in-place & stable.
    
    :param arr: List to be sorted.
    :return: Sorted list.
    """
    for i in range(len(arr)):
        for j in range(len(arr) - 1):
            # check if elements are in relative out-of-order
            if arr[j] > arr[j + 1]:
                # swapping adjacent elements
                arr[j], arr[j + 1] = arr[j + 1], arr[j]
    return arr