implement rudimentary collision detection