create function from part of code of read Teams from file