code to filter out duplicate rows