update scala linkedlist