Updated dynamic function name
solution to grains exercise.