This should work NOTE: The sorting definitely works, and the even median works, the odd one is buggy, so just look at the middle of the list if you have an odd amount of numbers in your dataset for now
I used a lot of Google Lens on this. Currently, "a mode" is just somewhere for me to dump random datasets. Sorry!