def get_coordination_number(connector):
    """
    This function can help us determine the coordination number of the top layer of the surface.

    Parameters:

    connector: the connector variable created by connection_matrix

    Return:
        A dictionary. {atom_index: coordination_number}
    """
    coord_num = {}
    for atom_index in connector:
        coord_num[atom_index] = len(connector[atom_index])
    return coord_num
