Changed the way that the main frame was created