join all the results into a string separated by newlines, append the result to output. join elements of output into a string, separated by newline characters, return the result.
return '\n' . join ( output )