Modiefied the MainWindow.xaml.cs