Functional for energy and line data.
Need to deal with identical energies