improved structure, added mcmc, small fixes