modified mutate operator (takes as parameter index of gen)