generic function for the window grids, hopefully