added trapizoidal method of integration