changed to use the csv writer instead doing it by hand
more complex term selection to use also terms composed by multiple words