private void apply() {
		int[][] config = new int[3 + levels.getSelectedIndex()][];
		try {
			config[0] = memorySettings.getConfiguration();
			config[1] = l1Instruction.getConfiguration();
			config[2] = l1Data.getConfiguration();
			if (levels.getSelectedIndex() > 0) 
				config[3] = l2Data.getConfiguration();
			if (levels.getSelectedIndex() > 1) 
				config[4] = l3Data.getConfiguration();
		} catch (Exception ex) {
			simulator.errorDialog.showError("Invalid/Missing input");
			return;
		}
		int[][] newConfig = new int[config.length][6];
		for (int i = 0; i < newConfig.length; i++) {
			newConfig[i][0] = config[i][0] * (int)Math.pow(1024, config[i][1]);
			newConfig[i][1] = config[i][2];
			newConfig[i][2] = config[i][3];
			newConfig[i][3] = config[i][4];
			if (config[i].length > 5) {
				newConfig[i][4] = config[i][5];
				newConfig[i][5] = config[i][6] + 2;
			}
		}
		try {
			Simulator.processor.configureStorage(newConfig);
			Simulator.processor.clear();
			memorySettings.setConfiguration(config[0]);
			l1Instruction.setConfiguration(config[1]);
			l1Data.setConfiguration(config[2]);
			if (levels.getSelectedIndex() > 0) 
				l2Data.setConfiguration(config[3]);
			if (levels.getSelectedIndex() > 1) 
				l3Data.setConfiguration(config[4]);
			selectedLevel = levels.getSelectedIndex();
		} catch (Exception ex) {
			simulator.errorDialog.showError(ex.getMessage());
			return;
		}
		simulator.storageViewer.refreshTypes();
		simulator.edit(false);
		setVisible(false);
	}