modify player1 code by Wei-Chien