updated traffic.py to use to include functions which house the functionality