added custom function to loop through open windos

need to make function more robust.  Currently breaks with three windows
stacked on one another