finish reworking calc_seq_energy