properly handling peaks (ignoring same points)
properly handling window
saving all data in y_vals
outputting to csv file 'out.csv' after trial