deleted references to energy_expectation
got rid of i counter variable