public void insertTileArray(int pg, int index, int oam[], int wid, int hgt, CHRTile[] tiles) {
		if ((index % 32 + wid) > 32) {
			// adjust wid so we dont wrap around
			wid -= ((index % 32 + wid) - 32);
		}
		if ((index + (32 * hgt) > (30 * 32))) {
			// adjust hgt so we dont mess up
			hgt -= ((index + (32 * hgt)) / 32) - 30;
		}
		// the index is in tiles (32 wide)
		// TO DO: fix this so I can stamp across pages.
		int tileCounter = 0;
		for (int y = 0; y < hgt; y++) {
			for (int x = 0; x < wid; x++) {
				int ntOffset = index + x + y * 32;
				modelRef.setNameTableTileAndOAM(pg, ntOffset, (byte) _activeStamp.getInsertionPointAt(tileCounter), (byte) oam[tileCounter]);
				tileCounter++;
			}
		}

		int mw = wid/2;
		int mh = hgt/2;
		
		int mtIndex = (index/64 * 16) + ((index%64)/2);
		
		repairMetaTileArray(determineNumPages(), metaTile.length);
		//System.out.println("Inserting meta starting at page:" + pg + " and index:" + mtIndex );
		// We also need to insert the metatile info into the metatile set and array.
		int metaCounter = _activeStamp.getMetaInsertionPoint();
		for(int y=0;y<mh;y++){
			for(int x=0;x<mw;x++){
				int mtOffset = mtIndex + x + y*16;				
				metaTile[pg][mtOffset] = metaCounter;
				metaCounter++;
			}
		}
		
		updateNameTable(pg);        // add to the name table

	}