def add_matrix(X, Y):
    """Adds two matrices"""
    result = [[(0.0) for x in range(len(X))] for y in range(len(X))]
    for i in range(len(X)):
        for j in range(len(X)):
            result[i][j] = X[i][j] + Y[i][j]
    return result
