'JQuery Double Elimination Loser Bracket Logic

I was needing a suggestion for anyone with experience with the JQuery Bracket Library My losers brackets in my webapp is not setup the way I need them to be. Mine often times creates an extra match for the first losers in the brackets that are not a power of 2. See this google doc below where i show mine vs correct dbl elim brackets. Any suggestions in the jquery logic where I could fix or may have gone wrong? See the doc below showing the comparison and contrast of correct vs what I have got. (https://docs.google.com/document/d/1DR6Qm6vNuSPqs6psJdpId3lY7agx_gJrBVDUe2VkkX8/edit?usp=sharing)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source