finished mutate code