diff --git a/script.pl b/script.pl
@@ -3,10 +3,10 @@
% Let S: N -> N be the sum of the digits of a positive integer.
% For all A and B in N, S(A + B) = S(A) + S(B) - 9k, where k is an integer.
-sum_digits(X, Y) :- sum_digits(X, 0, Y).
+sum_digits(X, Y) :- sum_digits_tail(X, 0, Y).
-sum_digits(X, Acc, Y) :- X < 10, !, Y is Acc + X.
-sum_digits(X, Acc, Y) :-
+sum_digits_tail(X, Acc, Y) :- X < 10, !, Y is Acc + X.
+sum_digits_tail(X, Acc, Y) :-
Q = X div 10,
R = X mod 10,
Acc1 = Acc + R,