updated main.c with linked list build and free additions