Make function for running the whole layout