created addPlayer function