public void write(int address, int data) {
		int sets = Cache.MAX_SIZE / this.assoc / this.blockSize;
		int blockNo = address / this.blockSize;
		int pos = blockNo % sets;
		byte tag = (byte) (address / sets);
		//MRU Way Prediction
		if (this.mru[pos] >= 0 && tag == this.tags[pos+this.mru[pos]]) {
			this.hit++;
			this.lruBits[pos+this.mru[pos]] = clock++;
			this.data[this.blockSize * (pos + this.mru[pos]) + (address % this.blockSize)] = data;
			if ((this.hit + this.miss) % 500 == 0) {
				this.missRates.put(this.hit + this.miss, (double) this.miss / (this.hit + this.miss));
			}
			return; 
		}
		//
		for (int i = 0; i < this.assoc; i++) {
			if (tag == this.tags[pos+i]) {
				this.hit++;
				this.lruBits[pos+i] = clock++;
				this.data[this.blockSize * (pos + i) + (address % this.blockSize)] = data;
				this.validBits[pos+i] = false;
				if ((this.hit + this.miss) % 500 == 0) {
					this.missRates.put(this.hit + this.miss, (double) this.miss / (this.hit + this.miss));
				}
				return;
			}
		}
		this.miss++;
		getFromMemory(address);
		for (int i = 0; i < this.assoc; i++) {
			if (tag == this.tags[pos+i]) {
				this.lruBits[pos+i] = clock++;
				this.data[this.blockSize * (pos + i) + (address % this.blockSize)] = data;
				this.validBits[pos+i] = false;
			}
		}
		if ((this.hit + this.miss) % 500 == 0) {
			this.missRates.put(this.hit + this.miss, (double) this.miss / (this.hit + this.miss));
		}
		return;
	}