use np.max and np.sum