public MemoryGameComponent(MemoryGrid game,int ngames) {
		super(); 
		timeFinished = new ArrayList<Long>(); 
		nGames=ngames;
		moveHistory=new ArrayList<ArrayList<long[]>>();
		currentMoves=new ArrayList<long[]>();
		currentTrial=0;
		numMoves=new ArrayList<Integer>();
		currentNumMoves=0;
		
		
		mainFrame=new JFrame();
		timer = new Timer(0, this);
		grid = game;
		buttons= new JButton[grid.getSize()];
		button2imageMap=new int[grid.getSize()];
		grid.shuffle();

		loadImageIcons(); // loads the array list of icons and sets imgBlank
		buildTiles();
		startTime = 0;//dummy val. it is initialized when first image is flipped
		mainFrame.addKeyListener(this);
		mainFrame.setFocusable(true);
		mainFrame.setFocusTraversalKeysEnabled(false);
		//mainFrame.addKeyListener(this);
		//timer.start();
		
	}