linkedlist version of lab4