Transferred main method from MainFrame to Main