public Integer[] getBestMatchingSegment(Integer c, Integer i, Integer t) {
        LinkedList<LinkedList<Boolean>> list = activeState.get(t);
        Integer maxActivity = 0;
        Integer result = -1;
        for(int j = 0; j < dendriteSegments.get(c).get(i).size(); j++) {
            Integer counter = 0;
            Segment segment = dendriteSegments.get(c).get(i).get(j);
            for(Synapse syn: segment.synapses) {
                if(list.get(syn.c).get(syn.i)) {
                    counter++;
                }
            }
            if (maxActivity < counter) {
                maxActivity = counter;
                result = j;
            }
        }
        return maxActivity > minThreshold ? new Integer[]{c, i, result} : new Integer[]{c, i, -1};
    }