>>46472487speed shouldn't be a stat, it should be an innate level: 1 2 3 or 4 specific to the pokemon
the higher number always outspeeds the lower, except for moves like extreme speed and quick attack which override it
if two pokemon are of the same speed tier, which one goes first is randomized.