Rewrote create_file() to be more concise.