I am struggling to connect these three rules together
<p>I'm having issues connecting the following three rules together.</p>

<pre><code>countingCombo([H|T], Sequence2) :-
   fact1(H, Sequence),
   append(Sequence, Sequence2, Sequence3),
   countingCombo(T, Sequence3).
countingCombo([], Combination) :-
   print(Combination),
   membersofCombo(Combination, X, C).

membersofCombo(List, X, C) :-
   sort(List, List1),
   member(X, List1),
   count(List, X, C).

count([], X, 0).
count([X|T], X, Y) :-
   count(T, X, Z),
   Y is 1+Z.
count([X1|T], X, Z) :-
   X1 \= X,
   count(T, X, Z).
</code></pre>

<p>countingcombo creates an appended list. membersofcombo, sorts that list and then produces each member of the original appended list, count rule then counts the occurences of each memeber.</p>

<p>membersofcombo and count work together, but I can't get countingcombo to connect to members of combo.</p>