Deciding the layout