<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def find_in_matrix_2d(val, matrix):
    '''
    Returns a tuple representing the index of an item in a 2D matrix.

    Arguments:
        - val (str) Value to look for
        - matrix (list) 2D matrix to search for val in

    Returns:
        - (tuple) Ordered pair representing location of val
    '''

    dim = len(matrix[0])
    item_index = 0

    for row in matrix:
        for i in row:
            if i == val:
                break
            item_index += 1
        if i == val:
            break

    loc = (int(item_index / dim), item_index % dim)

    return loc