Add sum of digits function
implemented validate