Fixed bugs

Trapezoidal rule function was repaired, a lot