I'm trying to make a small search engine using a binary search tree. The program reads in descriptions of books, stores each new book in a linked list, and each word of the description is stored in a binary search tree of that linked list. The input file I'm using is called "Book.txt" and looks like this:

4
Brock Read
Virus_course
The university teaches the course only to help those students
who want to learn to fight viruses Mr Barker insists pointing
to a growing movement in computer security that considers knowing
how a virus is constructed to be an essential step in halting
their spread The longer the industry ignores programs like
Calgarys he argues the more structural and financial damage the
virus will cause DOCUMENT_OVER

Aquinas network
Virus_Protection
Hoax virus messages are spread by well meaning people who
have heard about a virus usually contained in an email file
that will do all sorts of damage when a certain email message
is opened They want to inform their friends about it so they
email everyone they can think of to warn them There are no
viruses that are started when you open e-mail It is possible
to get an email that has an infected attachment The attachment
would contain either a program or a macro file that is infected
but you would not get a virus even from opening the attachment DOCUMENT_OVER

Richard Dawkins
The_Selfish_Gene
This book analyzes natural selection for a different
point of view than the usual view It describes genes
as being selfish in the gene pool and how thinking about
genes as attempting to survive in many copies in the gene
pool can do a better job of explaining the behavior of
species than the usual selfish individual or group model
can DOCUMENT_OVER

Ekta Bowers
Virus
Virus spreads from one computer to another over networked
lines virus writers exploit known bugs in installed software
anti virus firms help us to get rid of virus DOCUMENT_OVER
The first number tells how many different books are in the file, then authors name, then title of the book, followed by the description. DOCUMENT_OVER designates the end of a description. My code uses strncmp() to compare the word that was read in from the file to a string that contains "DOCUMENT_OVER" to end the book description, but for some reason DOCUMENT_OVER is being read into my BST and it shouldn't be... Then when I print the tree out it only prints "DOCUMENT_OVER" 5 times... I'm very new to C so ANY help or suggestions that you think may help me in the future would be much appreciated! Thanks!

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>

struct treenode {
	char *word;
	int occurence;
	struct treenode *left;
	struct treenode	*right;
}node;

struct summary{
	char *lname;
	char *fname;
	char *title;
	struct treenode node;
}info;

struct ll{
	struct summary info;
	struct ll *next;
}*List;

int lladd(struct treenode *myroot, char fname[30], char lname[30], char title[30]);
struct treenode* insert(struct treenode *root, struct treenode *temp);
struct treenode* create_node(char val[30]);
void inorder(struct treenode * current_ptr);

int main(void){
	int action=0, entries=0, words=0, i=0, j=0, str = 0, x=0, m=0;
	char over[30] = {'D','O','C','U','M','E','N','T','_','O','V','E','R'};
	char **query, filename[30], word[30], fname[30], lname[30], title[30];
	FILE *fp;
	struct treenode *temp= NULL, *root = NULL;


	printf("Which action would you like to perfrom?\n"
		" 1) Loading a list of books into the database.\n"
		" 2) Handling queries to the database.\n"
		" 3) Quit the program.\n");
	
	scanf("%d", &action);
	while(action < 3){
		if(action == 1){
			printf("\nEnter the name of your file: ");
			scanf("%s", filename);
			fp = fopen(filename, "r");
			
			if(fp == NULL){ 
				printf("\n\nSorry, that is an invalid file\n");
				return 0;
			}
			
			fscanf(fp, "%d", &entries);
			printf("%d\n", entries);
			while(x <= entries){
				fscanf(fp, "%s", fname);
				fscanf(fp, "%s", lname);
				fscanf(fp, "%s", title);
				while(strncmp(over, word, 13) != 0){
					fscanf(fp, "%s", word);
					if(strncmp(over, word, 13) != 0){
						i=0;
						str = strlen(word);
						while(i < str){
							word[i] = tolower(word[i]);
							i++;
						}
						temp = create_node(word);
						root = insert(root, temp);
					}
				}
				inorder(root);
				lladd(root, fname, lname, title);
				x++;
			}
		}
		if(action ==2){
			printf("\nHow many words are in your query?\n");
			scanf("%d", &words);
			printf("\nWhich words would you like to search for?\n");
			query = (char **)malloc(words * sizeof(char *)+1);
			for(i=0; i < words; i++){
				j=0;
				query[i] = (char *)malloc(sizeof(char));
				printf("%d). ", i+1);
				scanf("%s", query[i]);
				str = strlen(query[i]);
				while(j< str){
					query[i][j] = tolower(query[i][j]);
					j++;
				}
				printf("%s\n", query[i]);  //just to test if they were read in...
				if (find(root, query[i]) != 0)
				printf("\n\nWORD FOUND");
			}
		}
		//if (action ==3) program terminates
		printf("Which action would you like to perfrom?\n"
			" 1) Loading a list of books into the database.\n"
			" 2) Handling queries to the database.\n"
			" 3) Quit the program.\n");
		scanf("%d", &action);
	}
	return 0;
}

struct treenode* insert(struct treenode *root, struct treenode *temp){
	// element should be inserted to the right.
	
	// Inserting into an empty tree.
	if (root == NULL){
		root = (struct treenode*)malloc(sizeof(struct treenode));
		strcpy(root->word, temp->word);
		root->left = NULL;
		root->right = NULL;
		root->occurence = 1;
		return root;
	}
	else{
		if(strcmp(root->word, temp->word) == 0){
			root->occurence++;	
			return root;
		}
		// element should be inserted to the left.
		
		// There is a right subtree to insert the node.
		else if(strcmp(root->word, temp->word) > 0){
			if (root->right != NULL){
				root->right = insert(root->right, temp);
			}
			
			// Place the node directly to the right of root.
			else{
				root->right = (struct treenode*)malloc(sizeof(struct treenode));
				strcpy(root->right->word, temp->word);
				root->right->left = NULL;
				root->right->right = NULL;
				root->right->occurence = 1;
				return root;
			}
		}
		else if(strcmp(root->word, temp->word) < 0){
			
			// There is a left subtree to insert the node.
			if (root->left != NULL){
				root->left = insert(root->left, temp);
			}
			// Place the node directly to the left of root.
			else{
				root->left = (struct treenode*)malloc(sizeof(struct treenode));
				strcpy(root->left->word, temp->word);
				root->left->left = NULL;
				root->left->right = NULL;
				root->left->occurence = 1;
				return root;
			}
		}
	}
}

int find(struct treenode *current_ptr, char val[]) {
	// Check if there are nodes in the tree.
	if (current_ptr != NULL) {
		// Found the value at the root.
		if (strcmp(current_ptr->word, val) == 0){
			printf("\n\n%s", current_ptr->word);
			return current_ptr->occurence;
		}
		// Search to the left.
		if (strcmp(current_ptr->word, val) > 0) {
			return find(current_ptr->left, val);
		}
		// Or...search to the right.
		if(strcmp(current_ptr->word, val) < 0) {
			return find(current_ptr->right, val);
		}
	}
	else
		return 0;
}

int lladd(struct treenode *myroot, char fname[30], char lname[30], char title[30])
{
	int i=0;
	struct ll * pNew;
	pNew = (struct ll *) (malloc(sizeof(struct ll)));

	pNew->info.fname =  fname;
	pNew->info.lname = lname;
	pNew->info.title = title;
	pNew->info.node = *myroot;
	pNew->next = NULL;
	
	if(List == NULL)
		List  =  pNew;
	else
	{
		pNew->next  =  List;
		List  =  pNew ;
	}
	return 1;
}

struct treenode * create_node(char val[30]){
	// Allocate space for the node, set the fields.
	struct treenode * temp, *new;
	temp = (struct treenode*)malloc(sizeof(struct treenode));
	temp->word = val;
	temp->left = NULL;
	temp->right = NULL;
	new = temp;
	free(temp);
	return new; 	// Return a pointer to the created node.
}

void inorder(struct treenode * current_ptr) {

  // Only traverse the node if it's not null.
  if (current_ptr != NULL) {
    inorder(current_ptr->left); // Go Left.
    printf("%s \n", current_ptr->word); // Print the root.
    inorder(current_ptr->right); // Go Right.
  }
}