Question: > 
> **Possible Duplicate:**  
> 
> [How to open new browser window using javascript?](https://stackoverflow.com/questions/3616709/how-to-open-new-browser-window-using-javascript) 
> 
> 
> 

For example: <http://www.nowness.com/> > Click "Twitter"

I'm not asking about the Twitter API, just a generic window that I want to open up. jQuery can be used.

edit: Modal was the wrong term here. I wanted a popup, not a modal.

Answer: 
The problem isn't recursion. It's just that your first condition is always true: `endingIndex` is always greater than `beginningIndex`. That condition returns without recursion, so the function ends there.
Firstly, if you can't see what happened, it's because you need to print the returned string:

```
print FindIndex(sampleSet,0,lastIndex)

```

Now, if I run it I get:

```
beginningIndex: 0, endingIndex: 9
midpointIndex: 4.0, midpoint: -3
There is no value in this set such that a[i] = i

```

which means this `if` matched:

```
# check whether ending index is greater then beginning index
if (endingIndex > beginningIndex):
    return "There is no value in this set such that a[i] = i"

```

... well, of course it did - `endingIndex` *should* always be greater than `beginningIndex`!

---

For future reference, did you print the string? Did you see the output line and not understand why it took that branch? Did you try stepping through the code with `pdb`?