can set priors and measure energy. now working on nested algorithm