refactor
cleans file before writing
import from command line okay