public void Write(String WORD, int Addr) {
        
        int TAG=0;
        String sAddr = "";
        Integer OffSet;
        boolean OntheCache = false;
        
        OffSet = Addr%4; 
        TAG = Addr - OffSet; // block's physical address
        String sOffSet = ""; //00,01,10,11
        sOffSet = (OffSet<=1) ? "0" + String.format("%s", OffSet) : Long.toBinaryString(OffSet);
        int block=0;
        
        // check if it is in the CACHE block by block
        for(int i=0; i<=15; i++) {
            if (GetBlockTag(i) == TAG){ 
            /** WRITE HIT !..
              * we are using Write Back method
              * if data on the cache, we will not update the Memory right away
              * instead we set dirty bit and update it 
              * while we are swapping cache blocks from the memory
              */
                CACHE_DATA[i][1] = 1; // set Dirty bit, block updated
                //Set offSet bits to select the word asked
                CACHE_DATA[i][5] = Integer.parseInt(sOffSet.substring(0,1)); // first bit of offset 01 -> 1
                CACHE_DATA[i][6] = Integer.parseInt(sOffSet.substring(1,2)); // second bit of offset 01 -> 0
                UpdateWordInBlock(i,WORD);
              //  ControlPanel.jMessages.append("Write Hit!\n");
                OntheCache = true;
                break;
            }
        }
        
        if (!OntheCache) {
            /** WRITE MISS !..
              * Data is not on the cache so write to memory
              * Since we are using  write allocate method,
              * Fetch words from Memory
              */ 
          //System.out.println("Write Miss!");
          //  ControlPanel.jMessages.append("Write Miss!\n");
            sAddr = Long.toBinaryString(Addr);
            sAddr = String.format("%0" + (20-sAddr.length())+ "d", 0) + sAddr;
            ControlPanel.MEMORY.setDirect(WORD, sAddr);
            
            Fetch(TAG); 
           
        }
  }