Modified getEnergyFromExisting() and sortStructsByFormEnergy() methods.