changed queue to linkedlist