Improving assemblyBorderMST to assemble rectangle puzzle