implemented window selection