Use peekNext instead of getNext