public boolean addSample(int classLabel, MatrixDouble trainingSample) {
        if (trainingSample.getNumCols() != numDimensions) {
            System.err.println("addSample(int classLabel, MatrixDouble trainingSample) - The dimensionality of the training sample (" + trainingSample.getNumCols() + ") does not match that of the dataset (" + numDimensions + ")");
            return false;
        }

        //The class label must be greater than zero (as zero is used for the null rejection class label
        if (classLabel == 0 && !allowNullGestureClass) {
            System.err.println("addSample(int classLabel, MatrixDouble sample) - the class label can not be 0!");
            return false;
        }

        TimeSeriesClassificationSample newSample = new TimeSeriesClassificationSample(classLabel, trainingSample);
        data.add(newSample);
        totalNumSamples++;

        if (classTracker.size() == 0) {
            ClassTracker tracker = new ClassTracker(classLabel, 1);
            classTracker.add(tracker);
        } else {
            boolean labelFound = false;
            for (int i = 0; i < classTracker.size(); i++) {
                if (classLabel == classTracker.get(i).classLabel) {
                    classTracker.get(i).counter++;
                    labelFound = true;
                    break;
                }
            }
            if (!labelFound) {
                ClassTracker tracker = new ClassTracker(classLabel, 1);
                classTracker.add(tracker);
            }
        }
        return true;
    }