I'm so truly sorry, I tried my best to fix it but run out of time in the end, so I couldn't think of a propper algorithm to fix it. I appriciate the nice comments!
Nothing to be sorry for hahaha, this is the life of a Game Jam! Hopefully you learned some new skills or a new trick or two and now you're just that much better for next time! Keep making games!