             self.exportToText(currMatrix: self.dataMatrix, action: self.actionType)
             self.actionsLog = self.checkOutput(currentActions: self.actionsLog, newAction: self.actionType)
             let ind = self.actionsLog.index(of: self.actionType)
-            if ind! == 0 {
+            print(ind!)
+            if ind! == 0 || ind! == (self.actionsLog.count - 1) {
                 //This is the first misc action
                 self.miscActMatrix.append(self.dataMatrix)
             } else {

            do{
                let inference = try self.nn.infer(guessSample)
                print(inference)
                let rounded0 = String(format: "%.3f", inference[0])
                let rounded1 = String(format: "%.3f", inference[1])
                let roundedInfer = "[\(rounded0), \(rounded1)]"
                // Stand = [1, 0]
                // Walk = [0, 1]
                var action = ""
                if inference[0] > inference [1]{
                    action = "NeuralNet predicts: Standing\n\(roundedInfer)"
                } else if inference [0] < inference [1] {

    func nnInit(inputNums: Int, hiddenNums: Int, actLog: [String]) {
        do {
            let outputNums = actLog.count
            print(inputNums)
            print(hiddenNums)
            print(outputNums)
            structure = try NeuralNet.Structure(inputs: inputNums, hidden: hiddenNums, outputs: outputNums)
            config = try NeuralNet.Configuration(hiddenActivation: .rectifiedLinear, outputActivation: .sigmoid, cost: .meanSquared, learningRate: 0.4, momentum: 0.2)
            nn = try NeuralNet(structure: structure, config: config)
