added Center function to window