@Override
	/**
	 * This function removes a word from the Trie.
	 *
	 * @param  obj  Removes a String object from the Trie and correctly updates the ending 
	 * structure. The return value indicates that the object was removed successfully.
	 */
	public boolean remove(Object obj) {
		if(!(obj instanceof String)){
			return false;
		}
		String word = (String)obj;
		if (word.length() == 0) {
			return false;
		}
		if(!this.contains(word)){
			return false;
		}
		
		String[] letterArray = word.split("(?!^)");
		TrieNodeAbstract lastNode = this.root;
		for (String currentLetter : letterArray) {
			lastNode = (TrieNodeAbstract)lastNode.getNodeAt(currentLetter);
		}
		
		//Deal with the last node specially.
		if(!lastNode.isEmpty()){
			lastNode = this.convertToNonWordNode(lastNode);
		}else{
			lastNode.getParent().removeNodeAt(lastNode.getValue());
		}
		lastNode = lastNode.getParent();
		
		//While following the path back to the root, if we hit any words we are done
		//because the rest of the path is needed for the current word.
		while(lastNode != this.root){
			if(lastNode.isEndOfWord()){
				break;
			}
			if(lastNode.isEmpty()){
				lastNode.getParent().removeNodeAt(lastNode.getValue());
			}
			lastNode = lastNode.getParent();
		}
		
		this.size--;
		
		return true;
	}