zeroed file pointers after closing
renamed output file global variable