adding digit count method, counts the 1s digits in every number