Added newline characters before prefixes and at end (output was previously all on a single line)