what would size contain if digits.length == 0? Not string, I guess, and it looks like a type missmatch to me.