replace np.sum with loops