functions in class Player