updated to fix assignment problem, now runs approximately 5-10 times faster than with sampling from R
reimplemented burnin and variance reduction for metropolis sample step