working with dictionary, files: counting words frequency in text