alternative method for exceptions using previous digit