%%%%% macro FinalStateVar %%%%%%%%%%%%%%%%%%%
\newcommand{\StateLineDblTemp}{0}
\newcommand{\FinalStateVar}[3][]%
    {\ifStateLineDbl
        \renewcommand{\StateLineDblTemp}{1}
     \else
        \renewcommand{\StateLineDblTemp}{0}
     \fi
     \StateLineDouble
     \StateVar[#1]{#2}{#3}
     \ifthenelse{\equal{\StateLineDblTemp}{0}}%
                {\StateLineSimple}{}%
    }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
