Added method to determine energy
Further generalization to common