Added digit-sum function