removed redundant line

And replaced `np.cumprod` with `np.prod`