changed how some of the variables were declared and changed strcat to strcpy to copy filename to tmp
fixed the way strtok was being used
made strtok compare correctly by adding /n don't know why