refactor linked list and add printAllKeys()