     
     func bootStrapDataM(arr2D: [[Float]], setsNum: Int, startPt: Int, stride: Int, windowSize: Int, rowNums: Int) -> [[Float]]{
         let accel1DOnly = get1DArray(arr2D: arr2D, rowNums: rowNums)
-        var accel1Min = accel1DOnly.min()!
-        var accel1Max = accel1DOnly.max()!
+        let accel1Min = accel1DOnly.min()!
+        let accel1Max = accel1DOnly.max()!
         var halfRange:Float = 0
-        if accel1Max < Float(0){
-            accel1Max *= (-1)
-        }
-        if accel1Min < Float(0){
-            accel1Min *= (-1)
-        }
-        if accel1Max >= accel1Min{
+        if accel1Max >= Float(0) && accel1Min >= Float(0){
             halfRange = (accel1Max - accel1Min)/2
+        } else if accel1Max >= Float(0) && accel1Min <= Float(0){
+            halfRange = (accel1Max + (-1 * accel1Min))/2
         } else {
-            halfRange = (accel1Min - accel1Max)/2
-        }
+            halfRange = ((accel1Min * -1) - (accel1Max * -1))/2 + (accel1Max * -1) //adding max again to make all data >= 0
+        }
+        
         var processedArr = accel1DOnly.map{$0 + halfRange}
         var returnArray: [[Float]] = Array(repeating: Array(repeating: 0.0, count: windowSize), count: setsNum)
         var pointer1 = startPt

    }
    
    @IBAction func trainNNBPressed(_ sender: Any) {
        self.trainNN(nnet: nn, structure: structure, wTrainMatrix: walkTrainMatrix, wTestMatrix: walkTestMatrix, sTrainMatrix: standTrainMatrix, sTestMatrix: standTestMatrix)
    }
    

            
            let guessSample = self.guessMatrix[2]
            do{
                let inference = try self.nn.infer(guessSample)
                print(inference)
                // Stand = [1, 0]
                // Walk = [0, 1]
                var action = ""
                if inference[0] > inference [1]{
                    action = "NeuralNet predicts: Standing"
                } else if inference [0] < inference [1] {
                    action = "NeuralNet predicts: Walking"
                } else {
                    action = "NeuralNet's confused"
                }
                self.currentAppStatus.text = action
            } catch {print(error)}
        }

