public static void main(String args[]) throws IOException{

		String dict="/usr/share/dict/american";
		//creates vars used in the program
		String[][] dictMD5;
		boolean checked = false;
		
		//creates ArrayLists
		ArrayList<String> inputWords = new ArrayList<String>();
		ArrayList<String> dictWords = new ArrayList<String>();
		 

		
		//creates a buffer reader and writer for input words 
		BufferedReader indat = new BufferedReader(new FileReader(args[0]));
		String line;
		
		//creates a buffer reader and writer for dictionary words 
		BufferedReader inDict = new BufferedReader(new FileReader(dict));
	
		//reads files and imports them into their respective ArrayList
		while((line = indat.readLine()) != null){
			inputWords.add(line);
		}
	
		while((line = inDict.readLine()) != null)
			dictWords.add(line);
		
		//creates a temp array for the dictionary array for each word
		dictMD5 = new String[dictWords.size()][2];;
		
		//converts the dictionary array list to a 2d array that stores the dictionary word and its md5 equiv.
		for(int i = 0; i<dictWords.size(); i++){
			dictMD5[i][0]=dictWords.get(i);
			dictMD5[i][1]=wordsDict.md5(dictWords.get(i));
		}
		
		//creates an array for the input words to temporary live in
		String[] compare = new String[2];
		
		System.out.println("The Cracked Passwords are as follows: ");
		System.out.println("**Note: uncracked passwords will print out with the md5 hash. \n");
		
		for(int i = 0; i <inputWords.size();i++){
			
			//checks to see if an error is about to occur with array out of bounds exception and stops it
			if(i==inputWords.size())
				break;
			
			
			
			//splits the input array list into two separate strings. 
			//The delimiter is the semi-colon
			compare = (inputWords.get(i)).split(":");
			//goes through each 
			//System.out.println(compare[1]+"\n");
			for(int z = 0; z<dictWords.size(); z++){
				if(compare[1].equals(dictMD5[z][1].replaceAll(" ", ""))){
					System.out.println(compare[0] +":"+dictMD5[z][0]);
					checked = true;
					break;
				}
				
			}
			if(checked==false){
				System.out.println(inputWords.get(i));
			}
			checked =false;
		}
		indat.close();
	}