implemented base for collision detection