private void addSubTermConnections(){
		ArrayList<Integer> totalPagesInSelectedChapters = new ArrayList<>();
		for(int i = 0;i < selectedChapters.size();i++){
			for(int j = current.getChapter(selectedChapters.get(i)).getStart();j <= current.getChapter(selectedChapters.get(i)).getEnd();j++){
				totalPagesInSelectedChapters.add(j);
			}
		}
		for(int p = 0;p < rootTerms.size();p++){
			Term currentTerm = current.queryForTerm(rootTerms.get(p));
			Node root = getNode(currentTerm);
			if(currentTerm != null && root != null){
				Term termRoot = root.getTerm();
				for(int k = 0;k < subtermsInGraph.size();k++){
					Node currentSubTermNode = subtermsInGraph.get(k);
					Term currentSubTermTerm = currentSubTermNode.getTerm();
					ArrayList<Integer> pageRangesForSubTerm = currentSubTermTerm.getExtendedRange().getRanges();
					pageRangesForSubTerm = determinePagesOfTermInSelectedChapters(pageRangesForSubTerm, totalPagesInSelectedChapters);
					double correlationCoeffecient = determineCorrelationCoeffecient(current.getNumberOfPagesInSelectedChapters(termRoot, selectedChapters), pageRangesForSubTerm);
					if(correlationCoeffecient > 0 && !termRoot.getSubTerms().contains(currentSubTermTerm) && !termRoot.hasSubTerm(currentSubTermTerm.getTerm()) && !rootTerms.contains(currentSubTermTerm.getTerm()) && pageRangesForSubTerm.size() != 0){
						if(root.getSearchType() == 1){
							g.addEdge(new MyLink(correlationCoeffecient, 1.0), currentSubTermNode, root);
							float[] colorComponents = currentSubTermNode.getColor().getColorComponents(null);
							currentSubTermNode.updateScaledColor((float)(colorComponents[0]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS*correlationCoeffecient), colorComponents[1], colorComponents[2]);
							currentSubTermNode.updateColor((float)(colorComponents[0]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS), colorComponents[1], colorComponents[2]);
						}
						else if(root.getSearchType() == 2){
							g.addEdge(new MyLink(correlationCoeffecient, 1.0), currentSubTermNode, root);
							float[] colorComponents = currentSubTermNode.getColor().getColorComponents(null);
							currentSubTermNode.updateScaledColor(colorComponents[0], (float)(colorComponents[1]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS*correlationCoeffecient), colorComponents[2]);
							currentSubTermNode.updateColor(colorComponents[0], (float)(colorComponents[1]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS), colorComponents[2]);
						}
						else if(root.getSearchType() == 3){
							g.addEdge(new MyLink(correlationCoeffecient, 1.0), currentSubTermNode, root);
							float[] colorComponents = currentSubTermNode.getColor().getColorComponents(null);
							currentSubTermNode.updateScaledColor(colorComponents[0], colorComponents[1], (float)(colorComponents[2]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS*correlationCoeffecient));
							currentSubTermNode.updateColor(colorComponents[0], colorComponents[1], (float)(colorComponents[2]+MAX_ADDITIONAL_COLOR_FOR_POTENTIALLY_RELATED_TERMS));
						}
					}
				}
			}
		}
	}