Edit: I had originally intended for generation
0 to be the input word itself, and generation
1 to be the result of the first step. I.e., I had intended for you to return the before column. However, as I have not been clear enough in stating this, I will accept both options; for each generation you may return the value in either the before or the after column. You must state that you are following the after column, if you are doing so. You must also be consistent in which column you choose.
I will award the smallest code a week from now (10/27/2014).