Finished the basic collision detection