Added Collision Detection and fixed some bugs.