revised and abstracted move and merge, started on adjoin