implement print to file