now with collision detection