Committing flatten a linked list