updated for s_ij