Refactored. Queue now has a front and back which avoids traversing the entire queue to get to either end.