Added check digit functions