modifications - using classes instead of global variables and developing code for bigger data collection