create function for teamA and teamB