code to collect traffic data works