What is the intended logic here? What is `currentSize`? Is the current size of the queue (in which case, isnt `queue.size()` sufficient)?