update code for layout