Shockingly, the most efficient traffic flow I’ve ever been in was in 1998 Hanoi—in a region of the city with zero traffic lights or stop signs. The bulk of the traffic was on two and three wheels with the odd car thrown in, and while the streets were packed, pedestrians were able to cross, and vehicles maneuvered around each other at intersections despite their paths being perpendicular. It all worked because everyone was paying attention to everything, and everyone made allowances for everyone else. Hence everything moved, and the flow was astonishing to watch.

But while it was the most efficient I’d seen, it was certainly not the safest. In my short time there I saw no less than three accidents, all of them head-on collisions involving two-wheeled vehicles sometimes carrying up to three people.

In Holland, they’re aiming for both efficiency and safety, tackling the traffic problem with technology. The forward-thinking municipality of s’Hertogenbosch is, in the words of city councilman Jos van Son, “committed to good and safe traffic arrangements with minimal waiting times for our road users,” whether those users are pedestrians, cyclists, motorists or mass-transit takers, and they’re able to achieve this with a series of smart traffic lights. Here’s how they work:

Interestingly enough, s’Hertogenbosch “Traffic Regulation Installation Control Engineer” Eric Greweldinger confirms what I saw in pre-traffic-light Hanoi: “Humans are far better at negotiating the right of way than a traffic light installation can ever be,” he told the Bicycle Dutch blog. “So wherever possible we try to use exactly that principle.”

Another human quality Greweldinger is aware of is patience, or the lack thereof. “Nobody likes to wait unnecessarily long at a red light,” he explains. “Signals are an aid and they should only be used when there is no alternative.” With that in mind, Greweldinger and the team of technicians that he runs keep the lights short; they think in seconds and tenths of seconds. Here he explains the math:

“A motor vehicle needs about 2 seconds to start moving and clear the junction. If I have to prolong a cycle with 2 seconds, that means one car less through the intersection. Suppose the entire cycle is 60 seconds, then it would mean I have 60 cars fewer in one hour. That is 60 times the length of a car, or 60 times 5 to 6 metres. In other words: those 2 seconds will build me a traffic jam of 300 to 350 metres in just one hour.”

In Dutch traffic light installations, detection loops register every single road user. The times of the signals – red, as well as green times – are adjusted according to which road users have been detected. “If we have detected them well, and when we also determined their speed well, it is possible to give someone 3.2 seconds extra instead of 4 seconds. That 0.8 seconds difference can be given to other road users and you’ve just seen what a difference that can make. That is a true win!”