forgot to add cumtrapz back