Added function main which is implemented partially: only statistics about all files are written to file