new queue code complete - untested