Of what you call "filters", there is only ever one level, for everything. All the rest are undefined. If its target weakest, its based on power+attack+defence only. If its dying, its based on vit percent only. Let me give you some code if you dont believe me: [php] case 'weak': asort($sortcr_power, SORT_NUMERIC); $key = key($sortcr_power); $ret[] = $creatures[$key]; break;[/php] If the php sorting functions are deterministic, there is some determinism. But otherwise there is no further order imposed. Hence why I was saying you are overfitting your data as you are drawing conclusions where there are none. If there are two creatures with the same power, then its undefined precisely which one is chosen, and depends entirely on how PHP sorted the array. Same with dying, as is everything else. Hence, there is only one filter so anyone who is learning combat, please remember this (asthir please update your above posts by putting a warning). I suggest next time you run more tests, although clearly you have stated above that your tests disagreed (which surely led you to the conclusion your ideas about multiple filters was wrong?)