Solution 41; refactored isPanDigital