I am writing some papers for my class, and want to number the tasks with two or three levels. The first level should be a simple number like 1), while the next level should be labeled by numbers. Looking at this question How can I number paragraphs (and sections) in the margin? it almost answers what I need. I tried changing the numeration myself, but ran into some difficulties.

As one can see the first subparagraph is skipped and is replaced with a ). I do not know if my code is the best, and if anyone have a better way to obtain a similar output I would be glad to hear it. I find it a tad strange mixing \section and \subsection levels with the \paragraph ones.
\documentclass[10pt,a4paper]{article}
\usepackage{amssymb,mathtools} % Matematikk.
\usepackage{enumitem} % Mer muligheter for lister
\usepackage{titlesec}
\usepackage{etoolbox}
\setcounter{secnumdepth}{5}
\renewcommand\thesection{\bfseries\small\arabic{section})}
% this length controls tha hanging indent for titles
% change the value according to your needs
\newlength\titleindent
\setlength\titleindent{1cm}
\pretocmd{\paragraph}{\stepcounter{subsection}}{}{}
\pretocmd{\subparagraph}{\stepcounter{subsubsection}}{}{}
\newcounter{problem}[section]
\setcounter{problem}{1}
\renewcommand{\theproblem}{\bfseries\small\alph{problem})}
\titleformat{\paragraph}[runin]
{\normalfont\large}{\llap{\parbox{\titleindent}{\thesection\hfill}}\stepcounter{section}}{0em}{}
\titleformat{\subparagraph}[runin]
{\normalfont\large}{\llap{\parbox{\titleindent}{\theproblem\hfill}}\stepcounter{problem}}{0em}{}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{0em}
\titlespacing*{\subparagraph}{0pt}{3.25ex plus 1ex minus .2ex}{0em}
\setcounter{section}{1}
\begin{document}
\paragraph{}
Given an element $x$, $x_v$ is its value and $x_s$ its unit.
Let the set $D$ be a standard deck of $52$ cards.
\subparagraph{}
Find the cardinality of the following sets:
\begin{enumerate}[leftmargin=*]
\item $S = \left\{ x \in D \mid x_s = \text{spades} \right\}$
\item $B = \left\{ \text{the set of court cards in } D \right\}$
\item $S \cap B$
\item $S \cup B$
\item $S\,\backslash\,B$
\item $S \times B$
\item $\left\{ (x,y) \in D \times D \mid x = y \right\}$
\end{enumerate}
\subparagraph{}
Fill in the correct symbol $\in,\,\subseteq\,\, \nsubseteq$
\begin{enumerate}[leftmargin=*]
\item ace of hearts
\item ace of hearts
\item S D
\item S B
\end{enumerate}
\subparagraph{Fee fuu foo}
\end{document}

