Corrected isDigit code

Changed code so isDigit is called and used correctly