belongs to texts
function for storing result in files
more structure
typo
file name handling corrected