Added first drafts of Rains' algorithm and its generalisations