Keg is right in what he says - the system will sort people by onload and upgrade category, so the system does select the order. However, it can obviously be overwritten. It is clear there is no audit process after the flight has departed to make sure the rules are followed.