instead of having compare the condtional finds the tread with the max priority by looping through the list