STABLE VERSION: now computing gelman factors internally in c. there is also an R script to compute gelman factors in R after running the main program