added all the layout functionality