some code to read files and data analysis