public void resize() {

		setCapacity(this.capacity << 1);
		Entry[] newarray = new Entry[capacity];

		for (Entry entry : this.array) {
			while (entry != null) {
				Object key = entry.key;
				Object value = entry.value;
				int key_index_new = Math.abs(key.hashCode() % capacity);
				if (newarray[key_index_new] == null) {
					newarray[key_index_new] = new Entry(key, value);
				} else {
					Entry head = newarray[key_index_new];
					while (head != null && !head.key.equals(key)) {
						head = head.next;
					}
					if (head == null) {
						Entry to_add = new Entry(key, value);
						to_add.next = newarray[key_index_new];
						newarray[key_index_new] = to_add;
					} else {
						head.value = value;
					}
				}
				entry = entry.next;
			}
		}

		this.array = newarray;
	}