Found optimal window size