remove nested np.sum