solution 41; refactored IsPanDigital