Collision detection added with some bugs