Added function to center window