modified code to output an empty results file if the input reads or refe...

...rence file is empty