setting the best size for the window