add teamsByScore function to demo page