Refine standings code (much better!)