re-factor dealPlayer() function