error corrected_you first have to sort and give out the list
error corrected_deepcopy copys the values of values in a new array_a=b makes b point to the array a
error corrected_trapz takes the y values first