output to ns_file now working