Added collision detection (I hope)