Highest value in a scoreboard

I'm currently making a datapack that keeps track of kills around the server and then at the end of a specific period of time checks who has the most kills and labels them as the winner. But, i don't know how to get the highest value inside of a scoreboard. anyone could help me ? also the version im making the datapack on is in 1.20.1

Continue to help post