found an off-by-one, see if this works
found another off by one, starting to wonder how original code ever worked
works! hooray! add some final cleanups and clarifications
Revert "Revert "Merge branch 'fix/Queue_scan_consolidation' into edge""

This reverts commit e918c030e3ced39ce7d6f8d7a66d1ce8bb78e7d9.
Merge branch 'fix/Queue_scan_consolidation' into edge