just realized the queue isn't circular. God bless unit tests.
Test cases passing