public List<Integer[]> matchWords(String imageFolderLocation, List<Double[]> centroids, List<List<Double[]>> features) throws IOException {
		
		File folder = new File(imageFolderLocation);
		File[] files = folder.listFiles();
		List<Integer[]> list = new ArrayList<Integer[]>();
		int count = 0;
		
		for (File file : files) {
		    if (file.isFile() && !file.getName().equals(".DS_Store")) {
		        String name = imageFolderLocation + file.getName();
		        if(name.substring(name.length() - 4).equals(".jpg")) {
		            BufferedWriter writer = null;
		            try {
		        	    writer = new BufferedWriter(new FileWriter(name + "words.txt"));
		        	    Integer[] num = match(centroids, features.get(count++));
		        	    for(int i = 0; i < num.length; i++)
		        		    writer.write(num[i] + "\n");
		        	    list.add(num);
		        	    names.add(name);
		            } catch(IOException e) {
		        	    e.printStackTrace();
		            }
		            writer.close();
		        }
		    }
		}
		return list;
	}