public void endGame() {
		timeFinished.add(System.currentTimeMillis()-startTime);
		moveHistory.add(currentMoves);
		//for(ArrayList<long[]> a:moveHistory)
		//	System.out.println(a.size());
		numMoves.add(currentNumMoves);
		currentTrial++;
		currentMoves=new ArrayList<long[]>();
		currentNumMoves=0;
		
		if(currentTrial<nGames)
			nextLevel((int)(Math.random()*2));
		else{
			writeData("MemoryGameData");
			displayEndScreen();
		}
			
	}