Added function using autorun.jags