removed trailing whitespaces and commas