updated code so game works