data reduction script