adding missing newlines and fixing "last comma"