public void reduce(IntWritable key, Iterator<Text> values, OutputCollector<Text, IntWritable> output, Reporter reporter)
					throws IOException {
				ArrayList<Integer> nowGList = new ArrayList<Integer>();
				// generate nowGList
				
				for (Entry<Integer, Integer> entry : GList.entrySet()){
					if (entry.getValue() ==  key.get()){
						nowGList.add(entry.getKey());
					}
				}
				//System.out.println("NowGList " + nowGList.toString());
				//System.out.println("GList: " + GList.toString());
				LocalFPTree fpTree = new LocalFPTree();
				// for each transaction
				while (values.hasNext()){
					Text next = values.next();
					String strNext = next.toString();
					String[] transaction = strNext.substring(1, strNext.length() - 1).split(", ");
			
					ArrayList<Integer> listTransaction = new ArrayList<Integer>();
					for (int i = 0; i < transaction.length; i++){
						listTransaction.add(Integer.parseInt(transaction[i]));
					}
					
					//System.out.println("transaction list: " + listTransaction.toString());
					// input frequency for each transaction is 1
					FPTreeBuild(fpTree, listTransaction, 1);
					
				}
				TableNode test = fpTree.rootTableNode;
				while (test.hasNext()){
					test = test.getNext();// iterate table node
					TreeNode testTree = test.getFirst();
					while (true){
						if (testTree == null){
							break;
						}
						/*System.out.println("Name: " + testTree.getName()
								+ ";Height: " + testTree.getHeight()
								+ ";Count: " + testTree.getCount());
						*/
						testTree = testTree.getNextSameItem();
					}
				}
								
				PriorityQueue HP;
				Iterator<Integer> it = nowGList.iterator();
				ArrayList<Integer> pattern; 
				
				while (it.hasNext()){
					int nowItem = it.next();
					HP = new PriorityQueue(nowItem, K);
					pattern = new ArrayList<Integer>();
					pattern.add(nowItem);
					
					/*System.out.println("First: item name " + nowItem 
							+ ", HP name: " + HP.getName());
					*/
					TopKFPGrowth(fpTree, pattern, nowItem, HP);
					//System.out.println("HP and patterns: item " + HP.getName());
					//System.out.println("HP length: " + HP.getLength());
					
					int HPLength = HP.getLength();

					for (int i = 0; i < HPLength; i++){
						FrequentPattern fp = HP.getMinPattern();	
						IntWritable support = new IntWritable(fp.getSupport());
						Text textPattern = new Text(fp.getPattern().toString()); 
						output.collect(textPattern, support);
					}					
				}
				
			}// end of reducer