filled out the "play" function in Main.java