Improve comments.
Refactor to use temporary file.