implement main layout