Adding more functionality to queue.js