@Override
	public void insert(String value) 
	{
		// Keeps track if the value has a collision.
		boolean collisioned = false;
		
		// Gets rid of the values that are not words.
		if (value == null || !value.matches("^[a-zA-Z]+$"))
			return;
		int hashVal = hashFunc(value);
		
		// Iterate over the items until an opening is found (null) or if a same value already exists.
		while (hashArray[hashVal] != null && !hashArray[hashVal].getValue().equals(value))
		{
			// If it is the first time, then check if the current item has the same hash value as the new one.
			if (!collisioned && hashFunc(hashArray[hashVal].getValue()) == hashVal)
			{
				collisioned = true;
			}
			hashVal++;
			hashVal %= arraySize;
		}
		
		// If the item is a new item, then put it in place and increase the number of elements.
		if (hashArray[hashVal] == null)
		{
			hashArray[hashVal] = new DataItem(value.toLowerCase(), 1);
			numOfElements++;
			if (collisioned)
			{
				collisionCounter++;
			}
		}
		// else the item already exists and increase the counter.
		else
		{
			hashArray[hashVal].increaseFrequency();
		}
		
		// If after inserting the value, the load factor threshold is reached, then rehash the hash table.
		if (((double) size()) / arraySize > LOAD_FACTOR)
			rehash();
	}