added trapz