Start to code data analysis function