moved player code to player.java