in reply to getting the highest value in a simpler way

From the way the problem has been described, Foresaken's suggestion seems the best in the KISS category.

$max = 0; for $i (1 ..500) {#your loop $mutual = some_calculation; if ($mutual > $max) {$max = $mutual;) }