Implementing write list as a linked list instead of an array