finalizes layout