primitive implementation of luhn's method