added source code for traffic.py