working on fixing bugs in free-energy