refactored std_or_file_out/2 function
added feature_4