Copied io management from linked list project 5