added ability to read in layout from code