fixed printing and linked list