writing to separate files