code for layout