add traffic analysis code