implemented linkedlist q1