add function to return state for a player