create Player class

moved code from main into a class for the Player