updated for s_ij and E_min