Updated the layout functionality