add window_index option

includes docs and tests