public static void high(int length, int score) throws IOException {
//getting length from the configuration file
	//	int[] highs = new int[length];

		BufferedReader inputStream = null;
		inputStream = new BufferedReader(new FileReader("HighScore"));
		int x = 0;
		int pos = 0;
		while ((x = inputStream.read()) != -1) {
			highs[pos] = x;
			pos++;
		}



		if (inputStream.read() == -1) {
			inputStream.close();
		}
		if (score > highs[0]) {
			highs[0] = score;
		}
		highs = sort(highs);
		new File("HighScore").delete();
		highs = sort(highs);BufferedWriter in = new BufferedWriter(new FileWriter("HighScore"));

		for (int i = 0; i < highs.length; i++) {
			in.write(highs[i]);
		}
		in.close();

		inputStream = new BufferedReader(new FileReader("HighScore"));
int i=0;
		int z = 0;
		//int[] array = new int[length];

			while ((z = inputStream.read()) != -1) {
				highs[i] = z;
			i++;
		}
			inputStream.close();
		
	}