worked more on collision detection