createPlayer function