Collision detection WIP. I hope it's finally stable now, at least it hasn't crashed yet with this setup.