implementation code for queue.c/h, untested