Write main layout