More work on the routine to merge neighboring boundaries; I think I have a working algorithm