Added some collision detection