Code for reducing and analyzing data