added initial collision detection