Added collision code