fix bug in Adopt: repeated merging shouldn't be allowed
finished a working but slow implementation