Data manipulation and summary script