amend add to queue and remove from queue functions