change pairwise structure in calculate_energy 2