writing to file directly.