@Override
	public V remove(K key) {
		// default: search in old table
		int index = Math.abs(key.hashCode() % data.length);		
		Node<K, V>[]  currentTable = data;		
		
		// decide whether to search in old or new table
		if (index < min) {
			index = Math.abs(key.hashCode() % datanew.length);
			currentTable = datanew;
		}		
		
		Node<K, V> current = currentTable[index];
		
		if (current == null) {  // key does not exist
			return null;
			
		} else if (current.next == null) {   // only 1 node
			if (current.elem.key.equals(key)) {
				if (currentTable == datanew ||  
						datanew == null) {
					indexCount--;
				} 
				
				V retval = current.elem.value;
				currentTable[index] = null;
				return retval;
			}
			return null;
		}   
		
		// 
		Node<K, V> p = currentTable[index];		
		while(p.next != null && !p.next.elem.key.equals(key)) {
			p = p.next;
		}
		if (p.next != null) {
			V retval = p.next.elem.value;
			p.next = p.next.next;
			return retval;
		}
		return null;
	}