added ability to choose window