replaced digits generator with one line of code using only ruby functions to get the right result