Building the main frame