added integration of jags functions