synchronized public void updateRepDegree(byte[] fileID, int chunkNo, InetAddress addr, boolean removeOrAdd) {
		for(BackupChunk chunk : this.backedUpChunks) {
			if(Packet.bytesToHex(chunk.getFileID()).equals(Packet.bytesToHex(fileID)) && chunk.getChunkNo() == chunkNo) {
				boolean alreadyStored = false;
				for(InetAddress a : chunk.getStored())
				{
					if(a.equals(addr)) {
						alreadyStored = true;
						
						if(!removeOrAdd)
							chunk.getStored().remove(a);
						break;
					}
				}
				
				if(removeOrAdd && !alreadyStored) {
					chunk.increaseRepDegree();
					chunk.addToStored(addr);
				}
				else if (alreadyStored && !removeOrAdd){
					chunk.decreaseRepDegree();
				}

				updateLog();
				return;
			}
		}
	}