Update Mr. R's version

The for loop now iterates through the list, increasing n by one with each cycle. Before, n was assigned to the content of the list.