public void read() throws IOException{
		int i;
		String str="";			//used for file read function
		String numstr="";			//used for file read function
		String namelist[]=new String[100];    //namelist for highscores											
		int scorelist2[]=new int[100];			//score list for highscores
		int scorelist3[]=new int[100];
		int count=0;
		BufferedReader in = new BufferedReader(new FileReader("highscores.txt"));
		BufferedReader in2 = new BufferedReader(new FileReader("highscoreNames.txt"));
		while (str!= null && numstr!=null) {
			str=in2.readLine();
			numstr=in.readLine();		  
			if (str!= null && numstr!=null){
				i=Integer.parseInt(numstr);
				namelist[count]=str;         //enters the names
				scorelist[count]=i;        //enters the scores 
				scorelist2[count]=i;
				scorelist3[count]=i;			//another list used for sorting
				count++;
				if(count>=100){
					break;
				}
			}

		}  
		sort(scorelist,count);  //sorts the scores highest to lowest
		sort(scorelist3,count);
		for (int j=0;j<count;j++){
			for (int k=0;k<count;k++){
				if (scorelist2[j]==scorelist3[k]){
					namelist2[k]=namelist[j];       //matches the sorted scores with the corresponding names
					scorelist3[k]=-50;    		//if the same score appears, assigns a different value
					break;					  
				}
			}
		}
		in.close();
		in2.close();
		clearFiles();
	}