fixed data collection and analysis code so it is easier to use and finished normalization