A port of the patience-diff algorithm