 }
 
 enum GetValError:ErrorProtocol{
-case noVal(String)
+case noVal
 }
 
-func delete(_ ele: inout Int, _ array: inout [Int]){
+func delete(_ ele:Int, _ array: inout [Int]){
     var removeL = [Int]()
     for i in (0..<array.count) {
         if array[i] == ele{

    var pathVal = 0
    let valTest = m[pathRoot.last!][pathP]
    guard valTest != nil else{
        throw GetValError.noVal("No value")
    }
    for i in (1..<pathTemp.count) {
        pathVal = pathVal + m[pathTemp[i-1]][pathTemp[i]]!

    return PathResult(val:pathVal, pathList:pathTemp)
}

func dijkstra(start:Int, matrix m:[[Int?]] = example1) -> [PathResult]{
    // initialize
    var s:[Int] = [start]
    var u:[Int] = []
