changed sample to std::vector<sample> in mcmc_writer