Changed main() function: now it also writes each file of directory statistics separatelly in the same result file
Added if sentence to check if program is being executed not as a module and if not it runs main() function