revised the script to make plot for copad matching