finished linked list program, using recursion