first working version of traffic percentage calculation