Intelligent loop that does NOT add a comma to the end of a list of items