sorts on both capacity and queue size
simplifying some code, adding a slash between queue length