Reorganization of long script
seperate functions for analyzezscore.R