Added the feature of centering the window