added new tests, new queueing mechanism, and some performance improvements