public int read(int address) {
		if (this.cache.contains(address)) {
			return this.cache.read(address);
		} else {
			for (int i = 0; i < this.history.length; i++) {
				if (this.history[i] == address) {
					// conflict miss
					int mode = Integer.valueOf(this.cache.getMode(), 2);
					if (mode < 8)
						mode += 4;
					this.cache.setMode(Integer.toBinaryString(mode));
					System.out.println("Changing mode to " + Integer.toBinaryString(mode));
					return this.cache.read(address);
				}
			}
			//not found so It is first hit miss or capacity miss
			int mode = Integer.valueOf(this.cache.getMode(), 2);
			if (mode > 3)
				mode -= 3;
			else if (mode < 3)
				mode++;
			String newMode = Integer.toBinaryString(mode);
			while (newMode.length() < 4)
				newMode = '0' + newMode;
			this.cache.setMode(newMode);
			System.out.println("Changing mode to " + newMode);
			return this.cache.read(address);
		}
	}