writes to timestamped file