Redesigned layout system to work with new input format