def square_helper(start, finish, expand1, expand2, size_limit):
    
    """
    This function can expand one axis of the size of the bounding box.
    
    Parameters:
        start (int): the coordinate of the start point. 
        finish (int): the coordinate of the finish point.
        expand1 (int): the number of pixels used to expand the starting point.
        expand2 (int): the number of pixels used to expand the finishing point.
        size_limit (int): the maximum length of this expansion.
        
    Returns:
        new_start (int): the coordinate of the expanded start point.
        new_finish (int): the coordinate of the expanded finish point.

    """
    
    new_start = max(0, start - expand1)
    expand1_rem = expand1 - (start - new_start)
    new_finish = min(size_limit , finish + expand2)
    expand2_rem = expand2 - (new_finish - finish)

    # print('expand1_rem = ', expand1_rem, ' expand2_rem = ', expand2_rem)
    if expand1_rem > 0 and expand2_rem == 0:
        new_finish = min(size_limit, new_finish + expand1_rem)
    elif expand1_rem == 0 and expand2_rem > 0:
        new_start = max(0, new_start - expand2_rem)
    
    return new_start, new_finish