changed notebook data analysis into script