adding player function