moved jags model to be a function in the package