changed index queue to deque, slice is gone so didin't test