rudimentary collision detection