corrected index number error and added initial game logic