a simple way to write to a file