Created new variable name whick held file's name. Added keys (files' names) and values (statistics) to dictionary stat. Changed usage of function counting and  writing with new variables.