lesson 7: collision handling