Complete opening a file. Refactor output.