Added deduplication and looping over numeric variables