added linked list as a buffer