That sounds like you were driving just fine, but I'm curious how they almost killed you if you were in front of them?
I remember it took a second or two for me to figure out what was going on, while my mom was telling me to hit the brakes slowly and start leaning to the far-right of the road (where you stop if there is an emergency).