code for analyzing data