Updated with linkedlist functions