fix bug with simpsons rule