Data analysis code for