use np.sum instead of python sum