finished calc_seq_energy