measure and layout