Further implementation of FitWindow