merged new collision detection branch back into mainline