added multiselection merge/delete encounters and profiled build_internal_structure