There were many bugs happening with the previous code, it was also complex and not logic was written in many different places, so rewrote it from scratch
Pre-launch Checklist
[x] The Documentation is updated accordingly, or this PR doesn't require it.
[x] I updated/added relevant documentation (doc comments with ///).
[x] I listed at least one issue that this PR fixes in the description above.
[x] I added new tests to check the change I am making, or this PR is test-exempt.
Description
There were many bugs happening with the previous code, it was also complex and not logic was written in many different places, so rewrote it from scratch
Pre-launch Checklist
///
).