updated jags and stan code