building out the layout engine