this *should* fix the logic for outputting trailing commas on all lines but the last