if (temp > 9) {
        total += Math.floor(temp / 10) + (temp % 10);
      } else {
        total += temp;
      }