This research deals with the case of a smart intersection, where several cars approach the intersection from various directions, and a smart traffic light must decide about the time intervals of RED and GREEN in each direction, based not only on the number of vehicles in each lane, but also on other factors such as the type of vehicles (e.g. emergency vehicles), and the social characteristics of the passengers (e.g. a handicapped person, a student who is late for an exam). Those factors will be gleaned from the IoT (Internet of Things) network amongst cars, traffic lights, individuals, municipality data, and more. Once those priorities have been examined, they are fed into the algorithm we have devised, and outputted as a timing schedule for the different sides of the intersection. In this paper we present the algorithm, the prioritizing research, its implementation in the algorithm and initial results.